<!doctype html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><meta name=robots content="noodp"><meta http-equiv=x-ua-compatible content="IE=edge, chrome=1"><title>SSM实战项目 - Java高并发秒杀API - Yulin Lewis' Blog</title><meta name=keywords content="雨临Lewis,Java,hugo,hexo,博客"><meta name=Description content="不想当写手的码农不是好咸鱼_(xз」∠)_"><meta property="og:title" content="SSM实战项目 - Java高并发秒杀API"><meta property="og:description" content="前言
本文包括了项目的完整流程+开发过程中遇到的各种坑的总结+学习笔记和问题扩展
项目截图
秒杀列表


        
    秒杀列表"><meta property="og:type" content="article"><meta property="og:url" content="https://lewky.cn/posts/65067.html/"><meta property="og:image" content="https://lewky.cn/logo.png"><meta property="article:published_time" content="2017-10-03T13:25:43+08:00"><meta property="article:modified_time" content="2017-10-03T13:25:43+08:00"><meta name=twitter:card content="summary_large_image"><meta name=twitter:image content="https://lewky.cn/logo.png"><meta name=twitter:title content="SSM实战项目 - Java高并发秒杀API"><meta name=twitter:description content="前言
本文包括了项目的完整流程+开发过程中遇到的各种坑的总结+学习笔记和问题扩展
项目截图
秒杀列表


        
    秒杀列表"><meta name=application-name content="雨临Lewis的博客"><meta name=apple-mobile-web-app-title content="雨临Lewis的博客"><meta name=theme-color content="#ffffff"><meta name=msapplication-TileColor content="#da532c"><link rel="shortcut icon" type=image/x-icon href=/favicon.ico><link rel=icon type=image/png sizes=32x32 href=/favicon-32x32.png><link rel=icon type=image/png sizes=16x16 href=/favicon-16x16.png><link rel=apple-touch-icon sizes=180x180 href=/apple-touch-icon.png><link rel=mask-icon href=/safari-pinned-tab.svg color=#5bbad5><link rel=manifest href=/site.webmanifest><link rel=canonical href=https://lewky.cn/posts/65067.html/><link rel=prev href=https://lewky.cn/posts/a658ba27.html/><link rel=next href=https://lewky.cn/posts/56225.html/><link rel=stylesheet href=https://cdn.jsdelivr.net/npm/normalize.css@8.0.1/normalize.min.css><link rel=stylesheet href=/css/style.min.css><link rel=stylesheet href=https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.13.0/css/all.min.css><link rel=stylesheet href=https://cdn.jsdelivr.net/npm/animate.css@3.7.2/animate.min.css><script type=application/ld+json>{"@context":"http://schema.org","@type":"BlogPosting","headline":"SSM实战项目 - Java高并发秒杀API","inLanguage":"","mainEntityOfPage":{"@type":"WebPage","@id":"https:\/\/lewky.cn\/posts\/65067.html\/"},"genre":"posts","keywords":"项目笔记, SSM实战项目, 秒杀","wordcount":895,"url":"https:\/\/lewky.cn\/posts\/65067.html\/","datePublished":"2017-10-03T13:25:43+08:00","dateModified":"2017-10-03T13:25:43+08:00","license":"This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.","publisher":{"@type":"Organization","name":"雨临Lewis","logo":"https:\/\/lewky.cn\/images\/avatar.jpg"},"author":{"@type":"Person","name":"雨临Lewis"},"description":""}</script></head><body header-desktop=fixed header-mobile=auto><script type=text/javascript>(window.localStorage&&localStorage.getItem('theme')?localStorage.getItem('theme')==='dark':('auto'==='auto'?window.matchMedia('(prefers-color-scheme: dark)').matches:'auto'==='dark'))&&document.body.setAttribute('theme','dark');</script><div id=mask></div><div class=wrapper><header class=desktop id=header-desktop><div class=header-wrapper><a href=https://github.com/lewky class=github-corner target=_blank title="Follow me on GitHub" aria-label="Follow me on GitHub"><svg width="3.5rem" height="3.5rem" viewBox="0 0 250 250" style="fill:#70b7fd;color:#fff;position:absolute;top:0;border:0;left:0;transform:scale(-1,1)" aria-hidden="true"><path d="M0 0 115 115h15l12 27L250 250V0z"/><path d="M128.3 109C113.8 99.7 119 89.6 119 89.6 122 82.7 120.5 78.6 120.5 78.6 119.2 72 123.4 76.3 123.4 76.3 127.3 80.9 125.5 87.3 125.5 87.3 122.9 97.6 130.6 101.9 134.4 103.2" fill="currentcolor" style="transform-origin:130px 106px" class="octo-arm"/><path d="M115 115C114.9 115.1 118.7 116.5 119.8 115.4L133.7 101.6C136.9 99.2 139.9 98.4 142.2 98.6 133.8 88 127.5 74.4 143.8 58 148.5 53.4 154 51.2 159.7 51 160.3 49.4 163.2 43.6 171.4 40.1 171.4 40.1 176.1 42.5 178.8 56.2 183.1 58.6 187.2 61.8 190.9 65.4 194.5 69 197.7 73.2 200.1 77.6 213.8 80.2 216.3 84.9 216.3 84.9 212.7 93.1 206.9 96 205.4 96.6 205.1 102.4 203 107.8 198.3 112.5 181.9 128.9 168.3 122.5 157.7 114.1 157.9 116.9 156.7 120.9 152.7 124.9L141 136.5C139.8 137.7 141.6 141.9 141.8 141.8z" fill="currentcolor" class="octo-body"/></svg></a><div class=header-title><a href=/ title="Yulin Lewis' Blog"><span class=header-title-pre><i class="fas fa-fw fa-atom"></i></span>雨临Lewis</a></div><div class=menu><div class=menu-inner><div class=dropdown><a href=/posts/ class="menu-item menu-more dropbtn" title=点击查看所有文章><i class="fas fa-fw fa-archive"></i>归档</a><div class="menu-more-content dropdown-content"><a href=/categories/><i class="fas fa-fw fa-th"></i>分类 </a><a href=/tags/><i class="fas fa-fw fa-tag"></i>标签 </a><a href=/hot/ title=文章热度Top15><i class="fas fa-fw fa-fire"></i>热度 </a><a href=/donation/ title=感谢打赏，老板大气~><i class="fas fa-fw fa-donate"></i>打赏 </a><a href=/about/><i class="fas fa-fw fa-at"></i>关于</a></div></div><a class=menu-item href=/friends/ title=欢迎申请友链><i class="fas fa-fw fa-link"></i>友链</a><div class=dropdown><a href=javascript:void(0); class="menu-item menu-more dropbtn" title=一些有意思的东东~><i class="fas fa-fw fa-fan fa-spin"></i>趣味</a><div class="menu-more-content dropdown-content"><a href=/funny/high/ title="前方高能♂ 小心外放！" target=_blank rel=noopener><i class="fas fa-fw fa-dizzy"></i>燥起来！ </a><a href=/funny/mikutap/ title=初音未来音乐游戏 target=_blank rel=noopener><i class="fas fa-fw fa-music"></i>在线打碟 </a><a href=/funny/catch-the-cat/ title=逮住那只猫!><i class="fas fa-fw fa-cat"></i>抓住猫咪</a></div></div><div class=dropdown><a href=/ class="menu-item menu-more dropbtn" title=回到首页><i class="fas fa-fw fa-atom"></i>站点</a><div class="menu-more-content dropdown-content"><a href=/bbs/ title=来留言吧~><i class="fas fa-fw fa-comment"></i>公告留言 </a><a href=https://seo.chinaz.com target=_blank rel=noopener><i class="fas fa-fw fa-chart-line"></i>SEO查询 </a><a href=https://www.ping.cn/http/lewky.cn target=_blank rel=noopener><i class="fas fa-fw fa-bezier-curve"></i>网站测速 </a><a href=/posts/e62c38c4.html/><i class="fas fa-fw fa-cog fa-spin"></i>建站日志</a></div></div><div class=dropdown><a href=javascript:void(0); class="menu-item menu-more dropbtn"><i class="fas fa-fw fa-book"></i>文档</a><div class="menu-more-content dropdown-content"><a href=https://gohugo.io/documentation/ target=_blank rel=noopener><i class="fas fa-fw fa-star"></i>Hugo文档 </a><a href=https://javanote.doc.lewky.cn/ title=尚在完善中~ target=_blank rel=noopener><i class="fab fa-fw fa-java"></i>Java 笔记</a></div></div><a class=menu-item href=/search/ title=渲染搜索结果需要等待几秒钟~><i class="fas fa-fw fa-search"></i>搜索
</a><span class="menu-item delimiter"></span><a href=https://travellings.link target=_blank class=menu-item rel=noopener title=开往-友链接力><i class="fas fa-fw fa-subway"></i></a><a href=https://rssblog.vercel.app/ class=menu-item target=_blank rel=noopener title=RSSBlog><i class="fas fa-fw fa-inbox"></i></a><a href=https://github.com/lewky class=menu-item target=_blank rel=noopener title=GitHub><i class="fab fa-fw fa-github"></i></a></div></div></div></header><header class=mobile id=header-mobile><div class=header-container><div class=header-wrapper><div class=header-title><a href=/ title="Yulin Lewis' Blog"><span class=header-title-pre><i class="fas fa-fw fa-atom"></i></span>雨临Lewis</a></div><div class=menu-toggle id=menu-toggle-mobile><span></span><span></span><span></span></div></div><div class=menu id=menu-mobile><div class=dropdown><a href=/posts/ class="menu-item menu-more dropbtn" title=点击查看所有文章><i class="fas fa-fw fa-archive"></i>归档</a><div class="menu-more-content dropdown-content"><a href=/categories/><i class="fas fa-fw fa-th"></i>分类 </a><a href=/tags/><i class="fas fa-fw fa-tag"></i>标签 </a><a href=/hot/ title=文章热度Top15><i class="fas fa-fw fa-fire"></i>热度 </a><a href=/donation/ title=感谢打赏，老板大气~><i class="fas fa-fw fa-donate"></i>打赏 </a><a href=/about/><i class="fas fa-fw fa-at"></i>关于</a></div></div><a class=menu-item href=/friends/ title=欢迎申请友链><i class="fas fa-fw fa-link"></i>友链</a><div class=dropdown><a href=javascript:void(0); class="menu-item menu-more dropbtn" title=一些有意思的东东~><i class="fas fa-fw fa-fan fa-spin"></i>趣味</a><div class="menu-more-content dropdown-content"><a href=/funny/high/ title="前方高能♂ 小心外放！" target=_blank rel=noopener><i class="fas fa-fw fa-dizzy"></i>燥起来！ </a><a href=/funny/mikutap/ title=初音未来音乐游戏 target=_blank rel=noopener><i class="fas fa-fw fa-music"></i>在线打碟 </a><a href=/funny/catch-the-cat/ title=逮住那只猫!><i class="fas fa-fw fa-cat"></i>抓住猫咪</a></div></div><div class=dropdown><a href=/ class="menu-item menu-more dropbtn" title=回到首页><i class="fas fa-fw fa-atom"></i>站点</a><div class="menu-more-content dropdown-content"><a href=/bbs/ title=来留言吧~><i class="fas fa-fw fa-comment"></i>公告留言 </a><a href=https://seo.chinaz.com target=_blank rel=noopener><i class="fas fa-fw fa-chart-line"></i>SEO查询 </a><a href=https://www.ping.cn/http/lewky.cn target=_blank rel=noopener><i class="fas fa-fw fa-bezier-curve"></i>网站测速 </a><a href=/posts/e62c38c4.html/><i class="fas fa-fw fa-cog fa-spin"></i>建站日志</a></div></div><div class=dropdown><a href=javascript:void(0); class="menu-item menu-more dropbtn"><i class="fas fa-fw fa-book"></i>文档</a><div class="menu-more-content dropdown-content"><a href=https://gohugo.io/documentation/ target=_blank rel=noopener><i class="fas fa-fw fa-star"></i>Hugo文档 </a><a href=https://javanote.doc.lewky.cn/ title=尚在完善中~ target=_blank rel=noopener><i class="fab fa-fw fa-java"></i>Java 笔记</a></div></div><a class=menu-item href=/search/ title=渲染搜索结果需要等待几秒钟~><i class="fas fa-fw fa-search"></i>搜索</a>
<a href=https://travellings.link target=_blank class=menu-item rel=noopener title=开往-友链接力><i class="fas fa-fw fa-subway"></i></a><a href=https://rssblog.vercel.app/ class=menu-item target=_blank rel=noopener title=RSSBlog><i class="fas fa-fw fa-inbox"></i></a><a href=https://github.com/lewky class=menu-item target=_blank rel=noopener title=GitHub><i class="fab fa-fw fa-github"></i></a></div></div></header><div class="search-dropdown desktop"><div id=search-dropdown-desktop></div></div><div class="search-dropdown mobile"><div id=search-dropdown-mobile></div></div><main class=main><div class=container><div class=toc id=toc-auto><h2 class=toc-title>目录</h2><div class=toc-content id=toc-content-auto></div></div><article class="page single"><h1 class="single-title animated flipInX">SSM实战项目 - Java高并发秒杀API</h1><div class=post-meta><div class=post-meta-line><span class=post-author><a href=/ title=Author rel=author class=author><i class="fas fa-user-circle fa-fw"></i>雨临Lewis</a></span>&nbsp;<span class=post-category>收录于 <a href=/categories/seckill/><i class="far fa-folder fa-fw"></i>seckill</a></span></div><div class=post-meta-line><i class="far fa-calendar fa-fw"></i>&nbsp;<time datetime=2017-10-03>2017-10-03</time>&nbsp;<i class="far fa-calendar-plus fa-fw"></i>&nbsp;<time datetime=2017-10-03>2017-10-03</time>&nbsp;<i class="fas fa-pencil-alt fa-fw"></i>&nbsp;约 895 字
<i class="far fa-clock fa-fw"></i>&nbsp;预计阅读 2 分钟&nbsp;<span id=/posts/65067.html/ class=leancloud_visitors data-flag-title="SSM实战项目 - Java高并发秒杀API">
<i class="far fa-eye fa-fw"></i>&nbsp;<span class=leancloud-visitors-count></span>&nbsp;次阅读
</span>&nbsp;
<a href=#comments id=post-meta-vcount title=查看评论><i class="fas fa-comment fa-fw"></i>&nbsp;<span id=/posts/65067.html/ class=waline-comment-count></span>&nbsp;条评论</a></div></div><div class="details toc" id=toc-static kept><div class="details-summary toc-title"><span>目录</span>
<span><i class="details-icon fas fa-angle-right"></i></span></div><div class="details-content toc-content" id=toc-content-static><nav id=TableOfContents><ol><li><a href=#前言>前言</a></li><li><a href=#项目截图>项目截图</a><ol><li><a href=#秒杀列表>秒杀列表</a></li><li><a href=#秒杀详情页>秒杀详情页</a></li><li><a href=#错误提示>错误提示</a></li><li><a href=#开始秒杀>开始秒杀</a></li><li><a href=#秒杀成功>秒杀成功</a></li><li><a href=#重复秒杀>重复秒杀</a></li><li><a href=#秒杀倒计时>秒杀倒计时</a></li><li><a href=#秒杀结束>秒杀结束</a></li></ol></li><li><a href=#项目介绍>项目介绍</a></li><li><a href=#相关技术介绍>相关技术介绍</a></li><li><a href=#开发环境>开发环境</a></li><li><a href=#项目总结>项目总结</a></li></ol></nav></div></div><div class=content id=content><h2 id=前言>前言</h2><p>本文包括了项目的完整流程+开发过程中遇到的各种坑的总结+学习笔记和问题扩展</p><h2 id=项目截图>项目截图</h2><h3 id=秒杀列表>秒杀列表</h3><p><figure><a class=lightgallery href=https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master/images/posts/project/seckill/%e7%a7%92%e6%9d%80%e5%88%97%e8%a1%a8.jpg title=秒杀列表 data-thumbnail=https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master/images/posts/project/seckill/秒杀列表.jpg data-sub-html="<h2> </h2><p>秒杀列表</p>"><img class=lazyload src=/svg/loading.min.svg data-src=https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master/images/posts/project/seckill/%e7%a7%92%e6%9d%80%e5%88%97%e8%a1%a8.jpg data-srcset="https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master/images/posts/project/seckill/%e7%a7%92%e6%9d%80%e5%88%97%e8%a1%a8.jpg, https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master/images/posts/project/seckill/%e7%a7%92%e6%9d%80%e5%88%97%e8%a1%a8.jpg 1.5x, https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master/images/posts/project/seckill/%e7%a7%92%e6%9d%80%e5%88%97%e8%a1%a8.jpg 2x" data-sizes=auto alt=https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master/images/posts/project/seckill/秒杀列表.jpg></a><figcaption class=image-caption>秒杀列表</figcaption></figure></p><h3 id=秒杀详情页>秒杀详情页</h3><p><figure><a class=lightgallery href=https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master/images/posts/project/seckill/%e7%a7%92%e6%9d%80%e8%af%a6%e6%83%85%e9%a1%b5.jpg title=秒杀详情页 data-thumbnail=https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master/images/posts/project/seckill/秒杀详情页.jpg data-sub-html="<h2> </h2><p>秒杀详情页</p>"><img class=lazyload src=/svg/loading.min.svg data-src=https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master/images/posts/project/seckill/%e7%a7%92%e6%9d%80%e8%af%a6%e6%83%85%e9%a1%b5.jpg data-srcset="https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master/images/posts/project/seckill/%e7%a7%92%e6%9d%80%e8%af%a6%e6%83%85%e9%a1%b5.jpg, https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master/images/posts/project/seckill/%e7%a7%92%e6%9d%80%e8%af%a6%e6%83%85%e9%a1%b5.jpg 1.5x, https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master/images/posts/project/seckill/%e7%a7%92%e6%9d%80%e8%af%a6%e6%83%85%e9%a1%b5.jpg 2x" data-sizes=auto alt=https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master/images/posts/project/seckill/秒杀详情页.jpg></a><figcaption class=image-caption>秒杀详情页</figcaption></figure></p><h3 id=错误提示>错误提示</h3><p><figure><a class=lightgallery href=https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master/images/posts/project/seckill/%e9%94%99%e8%af%af%e6%8f%90%e7%a4%ba.jpg title=错误提示 data-thumbnail=https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master/images/posts/project/seckill/错误提示.jpg data-sub-html="<h2> </h2><p>错误提示</p>"><img class=lazyload src=/svg/loading.min.svg data-src=https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master/images/posts/project/seckill/%e9%94%99%e8%af%af%e6%8f%90%e7%a4%ba.jpg data-srcset="https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master/images/posts/project/seckill/%e9%94%99%e8%af%af%e6%8f%90%e7%a4%ba.jpg, https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master/images/posts/project/seckill/%e9%94%99%e8%af%af%e6%8f%90%e7%a4%ba.jpg 1.5x, https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master/images/posts/project/seckill/%e9%94%99%e8%af%af%e6%8f%90%e7%a4%ba.jpg 2x" data-sizes=auto alt=https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master/images/posts/project/seckill/错误提示.jpg></a><figcaption class=image-caption>错误提示</figcaption></figure></p><h3 id=开始秒杀>开始秒杀</h3><p><figure><a class=lightgallery href=https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master/images/posts/project/seckill/%e5%bc%80%e5%a7%8b%e7%a7%92%e6%9d%80.jpg title=开始秒杀 data-thumbnail=https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master/images/posts/project/seckill/开始秒杀.jpg data-sub-html="<h2> </h2><p>开始秒杀</p>"><img class=lazyload src=/svg/loading.min.svg data-src=https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master/images/posts/project/seckill/%e5%bc%80%e5%a7%8b%e7%a7%92%e6%9d%80.jpg data-srcset="https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master/images/posts/project/seckill/%e5%bc%80%e5%a7%8b%e7%a7%92%e6%9d%80.jpg, https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master/images/posts/project/seckill/%e5%bc%80%e5%a7%8b%e7%a7%92%e6%9d%80.jpg 1.5x, https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master/images/posts/project/seckill/%e5%bc%80%e5%a7%8b%e7%a7%92%e6%9d%80.jpg 2x" data-sizes=auto alt=https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master/images/posts/project/seckill/开始秒杀.jpg></a><figcaption class=image-caption>开始秒杀</figcaption></figure></p><h3 id=秒杀成功>秒杀成功</h3><p><figure><a class=lightgallery href=https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master/images/posts/project/seckill/%e7%a7%92%e6%9d%80%e6%88%90%e5%8a%9f.jpg title=秒杀成功 data-thumbnail=https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master/images/posts/project/seckill/秒杀成功.jpg data-sub-html="<h2> </h2><p>秒杀成功</p>"><img class=lazyload src=/svg/loading.min.svg data-src=https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master/images/posts/project/seckill/%e7%a7%92%e6%9d%80%e6%88%90%e5%8a%9f.jpg data-srcset="https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master/images/posts/project/seckill/%e7%a7%92%e6%9d%80%e6%88%90%e5%8a%9f.jpg, https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master/images/posts/project/seckill/%e7%a7%92%e6%9d%80%e6%88%90%e5%8a%9f.jpg 1.5x, https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master/images/posts/project/seckill/%e7%a7%92%e6%9d%80%e6%88%90%e5%8a%9f.jpg 2x" data-sizes=auto alt=https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master/images/posts/project/seckill/秒杀成功.jpg></a><figcaption class=image-caption>秒杀成功</figcaption></figure></p><h3 id=重复秒杀>重复秒杀</h3><p><figure><a class=lightgallery href=https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master/images/posts/project/seckill/%e9%87%8d%e5%a4%8d%e7%a7%92%e6%9d%80.jpg title=重复秒杀 data-thumbnail=https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master/images/posts/project/seckill/重复秒杀.jpg data-sub-html="<h2> </h2><p>重复秒杀</p>"><img class=lazyload src=/svg/loading.min.svg data-src=https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master/images/posts/project/seckill/%e9%87%8d%e5%a4%8d%e7%a7%92%e6%9d%80.jpg data-srcset="https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master/images/posts/project/seckill/%e9%87%8d%e5%a4%8d%e7%a7%92%e6%9d%80.jpg, https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master/images/posts/project/seckill/%e9%87%8d%e5%a4%8d%e7%a7%92%e6%9d%80.jpg 1.5x, https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master/images/posts/project/seckill/%e9%87%8d%e5%a4%8d%e7%a7%92%e6%9d%80.jpg 2x" data-sizes=auto alt=https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master/images/posts/project/seckill/重复秒杀.jpg></a><figcaption class=image-caption>重复秒杀</figcaption></figure></p><h3 id=秒杀倒计时>秒杀倒计时</h3><p><figure><a class=lightgallery href=https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master/images/posts/project/seckill/%e7%a7%92%e6%9d%80%e5%80%92%e8%ae%a1%e6%97%b6.jpg title=秒杀倒计时 data-thumbnail=https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master/images/posts/project/seckill/秒杀倒计时.jpg data-sub-html="<h2> </h2><p>秒杀倒计时</p>"><img class=lazyload src=/svg/loading.min.svg data-src=https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master/images/posts/project/seckill/%e7%a7%92%e6%9d%80%e5%80%92%e8%ae%a1%e6%97%b6.jpg data-srcset="https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master/images/posts/project/seckill/%e7%a7%92%e6%9d%80%e5%80%92%e8%ae%a1%e6%97%b6.jpg, https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master/images/posts/project/seckill/%e7%a7%92%e6%9d%80%e5%80%92%e8%ae%a1%e6%97%b6.jpg 1.5x, https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master/images/posts/project/seckill/%e7%a7%92%e6%9d%80%e5%80%92%e8%ae%a1%e6%97%b6.jpg 2x" data-sizes=auto alt=https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master/images/posts/project/seckill/秒杀倒计时.jpg></a><figcaption class=image-caption>秒杀倒计时</figcaption></figure></p><h3 id=秒杀结束>秒杀结束</h3><p><figure><a class=lightgallery href=https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master/images/posts/project/seckill/%e7%a7%92%e6%9d%80%e7%bb%93%e6%9d%9f.jpg title=秒杀结束 data-thumbnail=https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master/images/posts/project/seckill/秒杀结束.jpg data-sub-html="<h2> </h2><p>秒杀结束</p>"><img class=lazyload src=/svg/loading.min.svg data-src=https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master/images/posts/project/seckill/%e7%a7%92%e6%9d%80%e7%bb%93%e6%9d%9f.jpg data-srcset="https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master/images/posts/project/seckill/%e7%a7%92%e6%9d%80%e7%bb%93%e6%9d%9f.jpg, https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master/images/posts/project/seckill/%e7%a7%92%e6%9d%80%e7%bb%93%e6%9d%9f.jpg 1.5x, https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master/images/posts/project/seckill/%e7%a7%92%e6%9d%80%e7%bb%93%e6%9d%9f.jpg 2x" data-sizes=auto alt=https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master/images/posts/project/seckill/秒杀结束.jpg></a><figcaption class=image-caption>秒杀结束</figcaption></figure></p><h2 id=项目介绍>项目介绍</h2><blockquote><p>何为秒杀？</p></blockquote><p>所谓“秒杀”，就是网络卖家发布一些超低价格的商品，所有买家在同一时间网上抢购的一种销售方式。由于商品价格低廉，往往一上架就被抢购一空，有时只用一秒钟。</p><blockquote><p>为何选择Java高并发秒杀作为实战项目？</p></blockquote><ul><li>秒杀业务场景具有典型事务特性</li><li>秒杀/红包类需求越来越常见</li></ul><blockquote><p>为何使用SpringMVC+Spring+MyBatis框架</p></blockquote><ul><li>框架易于使用和轻量级</li><li>低代码侵入性</li><li>成熟的社区和用户群</li></ul><blockquote><p>能从该项目得到什么收获？</p></blockquote><ul><li>框架的使用和整合技巧</li><li>秒杀分析过程与优化思路</li></ul><blockquote><p>项目来源</p></blockquote><p>这是慕课网上的一个免费项目教学视频，名为Java高并发秒杀API，一共有如下四节课程，附带视频传送门（在视频中老师是用IDEA，本文用的是Eclipse）</p><ul><li><a href=http://www.imooc.com/learn/587 target=_blank rel="noopener noreffer">Java高并发秒杀API之业务分析与DAO层</a></li><li><a href=http://www.imooc.com/learn/631 target=_blank rel="noopener noreffer">Java高并发秒杀API之Service层</a></li><li><a href=http://www.imooc.com/learn/630 target=_blank rel="noopener noreffer">Java高并发秒杀API之Web层</a></li><li><a href=http://www.imooc.com/learn/632 target=_blank rel="noopener noreffer">Java高并发秒杀API之高并发优化</a></li></ul><h2 id=相关技术介绍>相关技术介绍</h2><blockquote><p>MySQL</p></blockquote><ul><li>表设计</li><li>SQL技巧</li><li>事务和行级锁</li></ul><blockquote><p>MyBatis</p></blockquote><ul><li>DAO层设计与开发</li><li>MyBatis合理使用</li><li>与Spring整合</li></ul><blockquote><p>Spring</p></blockquote><ul><li>Spring IOC整合Service</li><li>声明式事务运用</li></ul><blockquote><p>SpringMVC</p></blockquote><ul><li>Restful借口设计和使用</li><li>框架运作流程</li><li>Controller开发技巧</li></ul><blockquote><p>前端</p></blockquote><ul><li>交互设计</li><li>Bootstrap</li><li>jQuery</li></ul><blockquote><p>高并发</p></blockquote><ul><li>高并发点和高并发分析</li><li>优化思路并实现</li></ul><h2 id=开发环境>开发环境</h2><ul><li><strong>操作系统</strong>：Windows 8</li><li><strong>IDE工具</strong>：Eclipse</li><li><strong>JDK</strong>：JDK1.7</li><li><strong>中间件</strong>：Tomcat 7.0</li><li><strong>数据库</strong>：MySQL 5.0</li><li><strong>构建工具</strong>：Maven</li><li><strong>框架</strong>：SSM</li></ul><h2 id=项目总结>项目总结</h2><blockquote><p>本文根据慕课网的视频教学进行了相应的学习总结，全文较长，分为四节，附带CSDN传送门</p></blockquote><ul><li><a href=http://blog.csdn.net/lewky_liu/article/details/78159983 target=_blank rel="noopener noreffer"><strong>Java高并发秒杀API(一)之业务分析与DAO层</strong></a></li><li><a href=http://blog.csdn.net/lewky_liu/article/details/78162149 target=_blank rel="noopener noreffer"><strong>Java高并发秒杀API(二)之Service层</strong></a></li><li><a href=http://blog.csdn.net/lewky_liu/article/details/78162153 target=_blank rel="noopener noreffer"><strong>Java高并发秒杀API(三)之Web层</strong></a></li><li><a href=http://blog.csdn.net/lewky_liu/article/details/78166080 target=_blank rel="noopener noreffer"><strong>Java高并发秒杀API(四)之高并发优化</strong></a></li></ul><blockquote><p>项目源码</p></blockquote><ul><li><a href=http://download.csdn.net/download/lewky_liu/10013556 target=_blank rel="noopener noreffer"><strong>源码下载</strong></a></li><li><a href=https://github.com/lewky/Seckill target=_blank rel="noopener noreffer"><strong>GitHub地址</strong></a></li></ul><div class="details admonition warning open"><div class="details-summary admonition-title"><i class="icon fas fa-exclamation-triangle fa-fwwarning"></i>警告<i class="details-icon fas fa-angle-right fa-fw"></i></div><div class=details-content><div class=admonition-content>本文最后更新于 <span class=timeago datetime=2017-10-03T13:25:43 title="October 3, 2017">October 3, 2017</span>，文中内容可能已过时，请谨慎使用。</div></div></div><div class=post-reward><input type=checkbox name=reward id=reward hidden>
<label class=reward-button for=reward>赞赏支持</label><div class=qr-code><label class=qr-code-image for=reward><img class=image src=https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master/images/common/wechat.png>
<span>微信打赏</span></label>
<label class=qr-code-image for=reward><img class=image src=https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master/images/common/alipay.png>
<span>支付宝打赏</span></label></div></div></div><div class=post-footer id=post-footer><div class=post-info><div class=post-info-line><div class=post-info-mod><span>更新于 2017-10-03</span></div><div class=post-info-license><span><a rel="license external nofollow noopener noreffer" href=https://creativecommons.org/licenses/by-nc/4.0/ target=_blank>CC BY-NC 4.0</a></span></div></div><div class=post-info-line><div class=post-info-md><span><a class=link-to-markdown href=/posts/65067.html/index.md target=_blank>阅读原始文档</a></span></div><div class=post-info-share><span><a href=javascript:void(0); title="分享到 Twitter" data-sharer=twitter data-url=https://lewky.cn/posts/65067.html/ data-title="SSM实战项目 - Java高并发秒杀API" data-hashtags=项目笔记,SSM实战项目,秒杀><i class="fab fa-twitter fa-fw"></i></a><a href=javascript:void(0); title="分享到 Facebook" data-sharer=facebook data-url=https://lewky.cn/posts/65067.html/ data-hashtag=项目笔记><i class="fab fa-facebook-square fa-fw"></i></a><a href=javascript:void(0); title="分享到 Hacker News" data-sharer=hackernews data-url=https://lewky.cn/posts/65067.html/ data-title="SSM实战项目 - Java高并发秒杀API"><i class="fab fa-hacker-news fa-fw"></i></a><a href=javascript:void(0); title="分享到 Line" data-sharer=line data-url=https://lewky.cn/posts/65067.html/ data-title="SSM实战项目 - Java高并发秒杀API"><i data-svg-src=https://cdn.jsdelivr.net/npm/simple-icons@2.14.0/icons/line.svg></i></a><a href=javascript:void(0); title="分享到 微博" data-sharer=weibo data-url=https://lewky.cn/posts/65067.html/ data-title="SSM实战项目 - Java高并发秒杀API"><i class="fab fa-weibo fa-fw"></i></a></span></div></div></div><div class=post-info-more><section class=post-tags><i class="fas fa-tags fa-fw"></i>&nbsp;<a href=/tags/%E9%A1%B9%E7%9B%AE%E7%AC%94%E8%AE%B0/>项目笔记</a>,&nbsp;<a href=/tags/ssm%E5%AE%9E%E6%88%98%E9%A1%B9%E7%9B%AE/>SSM实战项目</a>,&nbsp;<a href=/tags/%E7%A7%92%E6%9D%80/>秒杀</a></section><section><span><a href=javascript:void(0); onclick=window.history.back();>返回</a></span>&nbsp;|&nbsp;<span><a href=/>主页</a></span></section></div><div class=post-nav><a href=/posts/a658ba27.html/ class=prev rel=prev title="Maven - 依赖范围和传递性依赖"><i class="fas fa-angle-left fa-fw"></i>Maven - 依赖范围和传递性依赖</a>
<a href=/posts/56225.html/ class=next rel=next title=Java高并发秒杀API(一)之业务分析与DAO层>Java高并发秒杀API(一)之业务分析与DAO层<i class="fas fa-angle-right fa-fw"></i></a></div></div><div id=comments><div id=waline></div><script src=https://cdn.jsdelivr.net/npm/@waline/client/dist/Waline.min.js></script><script>new Waline({el:'#waline',meta:["nick","mail","link"],requiredMeta:["nick","mail"],login:"force",placeholder:"为防恶意灌水攻击，评论前需注册并登录，望见谅~",serverURL:"https://comment.lewky.cn/",avatarCDN:"https://sdn.geekzu.org/avatar/",pageSize:20,avatar:"retro",lang:"zh-CN",visitor:true,highlight:true,uploadImage:false,emoji:['https:\/\/cdn.jsdelivr.net\/gh\/lewky\/lewky.github.io@master/images/emoji/嘉然今天吃什么','https:\/\/cdn.jsdelivr.net\/gh\/lewky\/lewky.github.io@master/images/emoji/大航海嘉然','https:\/\/cdn.jsdelivr.net\/gh\/lewky\/lewky.github.io@master/images/emoji/向晚大魔王','https:\/\/cdn.jsdelivr.net\/gh\/lewky\/lewky.github.io@master/images/emoji/贝拉kira','https:\/\/cdn.jsdelivr.net\/gh\/lewky\/lewky.github.io@master/images/emoji/珈乐Carol','https:\/\/cdn.jsdelivr.net\/gh\/lewky\/lewky.github.io@master/images/emoji/乃琳Queen','https:\/\/cdn.jsdelivr.net\/gh\/lewky\/lewky.github.io@master/images/emoji/EveOneCat','https://cdn.jsdelivr.net/gh/walinejs/emojis@1.0.0/weibo','https:\/\/cdn.jsdelivr.net\/gh\/lewky\/lewky.github.io@master/images/emoji/滑稽','https:\/\/cdn.jsdelivr.net\/gh\/lewky\/lewky.github.io@master/images/emoji/default']});</script></div></article></div></main><footer class=footer><div class=footer-container><div class=footer-line><span id=run-time></span>|
<a href=http://rssblog.vercel.app/ target=_blank rel=noopener title=RSSBlog><i class="fas fa-fw fa-inbox"></i>&nbsp;RSSBlog</a></div><div class=footer-line><i class="far fa-copyright fa-fw"></i><span itemprop=copyrightYear>2018 - 2022</span><span class=author itemprop=copyrightHolder>&nbsp;<a href=/ target=_blank>雨临Lewis</a></span>&nbsp;|&nbsp;<span class=license><a rel="license external nofollow noopener noreffer" href=https://creativecommons.org/licenses/by-nc/4.0/ target=_blank>CC BY-NC 4.0</a></span><span class=icp-splitter>&nbsp;|&nbsp;</span><br class=icp-br><span class=icp><a target=_blank href=http://www.beian.miit.gov.cn/ style=font-weight:700>粤ICP备19103822</a></span></div></div></footer></div><div id=fixed-buttons><a href=# id=back-to-top class=fixed-button title=回到顶部><i class="fas fa-arrow-up fa-fw"></i></a><a href=# id=view-comments class=fixed-button title=查看评论><i class="fas fa-comment fa-fw"></i></a></div><div class=sidebar_wo><div id=leimu><img src=https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master/images/b2t/leimuA.png alt=雷姆 onmouseover="this.src='https:\/\/cdn.jsdelivr.net\/gh\/lewky\/lewky.github.io@master/images/b2t/leimuB.png'" onmouseout="this.src='https:\/\/cdn.jsdelivr.net\/gh\/lewky\/lewky.github.io@master/images/b2t/leimuA.png'" title=回到顶部></div><div class=sidebar_wo id=lamu><img src=https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master/images/b2t/lamuA.png alt=雷姆 onmouseover="this.src='https:\/\/cdn.jsdelivr.net\/gh\/lewky\/lewky.github.io@master/images/b2t/lamuB.png'" onmouseout="this.src='https:\/\/cdn.jsdelivr.net\/gh\/lewky\/lewky.github.io@master/images/b2t/lamuA.png'" title=回到底部></div></div><link rel=stylesheet href=https://cdn.jsdelivr.net/npm/lightgallery.js@1.2.0/dist/css/lightgallery.min.css><script type=text/javascript src=https://cdn.jsdelivr.net/npm/smooth-scroll@16.1.3/dist/smooth-scroll.min.js></script><script type=text/javascript src=https://cdn.jsdelivr.net/npm/lazysizes@5.2.2/lazysizes.min.js></script><script type=text/javascript src=https://cdn.jsdelivr.net/npm/lightgallery.js@1.2.0/dist/js/lightgallery.min.js></script><script type=text/javascript src=https://cdn.jsdelivr.net/npm/lg-thumbnail.js@1.2.0/dist/lg-thumbnail.min.js></script><script type=text/javascript src=https://cdn.jsdelivr.net/npm/lg-zoom.js@1.2.0/dist/lg-zoom.min.js></script><script type=text/javascript src=https://cdn.jsdelivr.net/npm/clipboard@2.0.6/dist/clipboard.min.js></script><script type=text/javascript src=https://cdn.jsdelivr.net/npm/sharer.js@0.4.0/sharer.min.js></script><script type=text/javascript>window.config={"code":{"copyTitle":"复制到剪贴板","maxShownLines":30},"comment":{},"lightGallery":{"actualSize":false,"exThumbImage":"data-thumbnail","hideBarsDelay":2000,"selector":".lightgallery","speed":400,"thumbContHeight":80,"thumbWidth":80,"thumbnail":true}};</script><script type=text/javascript src=/js/theme.min.js></script><script type=text/javascript src=https://cdn.jsdelivr.net/npm/jquery@2.1.3/dist/jquery.min.js></script><script type=text/javascript src=https://cdn.jsdelivr.net/npm/jquery-backstretch@2.1.18/jquery.backstretch.min.js></script><script>var $cdnPrefix="https://cdn.jsdelivr.net/gh/lewky/lewky.github.io@master";</script><script type=text/javascript src=/js/custom.js></script><script>var _hmt=_hmt||[];(function(){var hm=document.createElement("script");hm.src="https://hm.baidu.com/hm.js?6f278ed0fdb01edb3b1e7398379e5432";var s=document.getElementsByTagName("script")[0];s.parentNode.insertBefore(hm,s);})();</script></body></html>